

/* ********************************************************************************************
*  Alvin Baldemeca
*  Tetris Project
*  Course: TCSS 305 , Alan Fowler
*  Term: Spring 2012
*  UNIVERISTY OF WASHINGTON TACOMA
*
*
**********************************************************************************************/

package gui.actions;



import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;


import javax.swing.AbstractAction;
import javax.swing.Action;
import view.TetrisBoardPanel;




/**
 * An action that starts a timer.
 * @author Alvin Baldemeca
 * @version 5/25/2012
 */
@SuppressWarnings("serial")
public class GridBaordAction extends AbstractAction
{ 
  /**
   * The panel that represents the tetris board.
   */
  private final TetrisBoardPanel my_panel;

  
  /**
   * Creates a StartAction.
   * @param the_panel to paint the grid on the board to.
   */
  public GridBaordAction(final TetrisBoardPanel the_panel)
  {
    super("Baord Grid");
    putValue(Action.MNEMONIC_KEY, KeyEvent.VK_I);
    putValue(Action.SELECTED_KEY, false);
    my_panel = the_panel;
  }

  @Override
  public void actionPerformed(final ActionEvent the_event) 
  {
    my_panel.setGrid((Boolean) getValue(Action.SELECTED_KEY));
    my_panel.repaint();
  }
  
}
